package com.whfc.safety.service;

import com.whfc.common.exception.BizException;
import com.whfc.common.result.PageVO;
import com.whfc.entity.dto.statistics.CheckDetailDTO;
import com.whfc.entity.dto.statistics.CheckStatisticsDTO;
import com.whfc.entity.dto.statistics.StatisticsProgressDTO;
import com.whfc.entity.param.check.CheckSearchParam;
import com.whfc.safety.dto.*;
import com.whfc.safety.param.SafetyCheckListParam;
import com.whfc.safety.param.SafetyCheckLogParam;
import com.whfc.safety.param.SafetyCheckParam;

import java.util.Date;
import java.util.List;

/**
 * @ClasssName SafetyCheckService
 * @Description 安全管理问题上报接口类
 * @Author hw
 * @Date 2020/8/5 9:42
 * @Version 1.0
 */
public interface SafetyCheckService {

    /**
     * 安全问题上报
     *
     * @param safetyCheckParam 问题上报请求类
     * @throws BizException 业务异常
     * @author hw
     * @date 2020/8/5 9:47
     **/
    void addCheck(SafetyCheckParam safetyCheckParam) throws BizException;

    /**
     * 删除检查记录
     *
     * @param checkId 检查记录ID
     * @throws BizException 业务异常
     */
    void delCheck(Integer checkId) throws BizException;

    /**
     * 安全问题处理流程
     *
     * @param safetyCheckLogParam 安全问题流程处理请求类
     * @return
     * @throws BizException 业务异常
     * @author hw
     * @date 2020/8/5 9:50
     **/
    void addCheckLog(SafetyCheckLogParam safetyCheckLogParam) throws BizException;


    /**
     * 查询问题上报列表
     *
     * @param safetyCheckListParam 问题上报请求类
     * @return SafetyCheckListDTO
     * @throws BizException 业务异常
     * @author hw
     * @date 2020/8/5 10:14
     **/
    SafetyCheckListDTO list(SafetyCheckListParam safetyCheckListParam) throws BizException;

    /**
     * 查询问题上报列表
     *
     * @param safetyCheckListParam 问题上报请求类
     * @return SafetyCheckListDTO
     * @throws BizException 业务异常
     * @author hw
     * @date 2020/8/5 10:14
     **/
    List<SafetyCheckDTO> dayLogList(SafetyCheckListParam safetyCheckListParam) throws BizException;

    /**
     * 查询问题上报详情
     *
     * @param checkId 问题id
     * @return SafetyCheckDescDTO
     * @throws BizException 业务异常
     * @author hw
     * @date 2020/8/5 10:19
     **/
    SafetyCheckDescDTO desc(Integer checkId) throws BizException;


    /**
     * 查询统计信息
     *
     * @param deptId    组织机构ID
     * @param channel   渠道code 1-月；2-年
     * @param startTime 开始时间
     * @param endTime   结束时间
     * @return SafetyCheckStatisticalDTO
     * @throws BizException 业务异常
     * @author hw
     * @date 2020/8/5 10:26
     **/
    SafetyCheckStatisticalDTO statistical(Integer deptId, Date startTime, Date endTime, Integer channel) throws BizException;
    /**
     * 查询统计信息V2
     *
     * @param deptId    组织机构ID
     * @param channel   渠道code 1-月；2-年
     * @param startTime 开始时间
     * @param endTime   结束时间
     * @return SafetyCheckStatisticalDTO
     * @throws BizException 业务异常
     * @author hw
     * @date 2020/8/5 10:26
     **/
    SafetyCheckStatisticalDTO statistical(Integer deptId, Integer userId,Date startTime, Date endTime, Integer channel) throws BizException;

    /**
     * 查询全部上报信息
     *
     * @return List<SafetyCheckDTO>
     * @throws BizException 业务异常
     * @author hw
     * @date 2020/8/12 9:19
     **/
    @Deprecated
    List<Integer> getCheckIds() throws BizException;

    /**
     * 更新超期状态
     *
     * @param checkIds 问题id
     * @return
     * @throws BizException 业务异常
     * @author hw
     * @date 2020/8/12 11:28
     **/
    @Deprecated
    void updateOverdue(List<Integer> checkIds) throws BizException;

    /**
     * 问题日志
     *
     * @param deptId
     * @param date
     * @return
     * @throws BizException
     */
    SafetyLogDTO safetyLog(Integer deptId, Date date) throws BizException;

    /**
     * 导出隐患问题
     *
     * @param safetyIds
     * @throws BizException
     */
    void safetyExport(List<Integer> safetyIds, Integer deptId) throws BizException;

    /**
     * 检查统计
     *
     * @param deptId
     * @param startTime
     * @param endTime
     * @return
     * @throws BizException
     */
    SafetyCheckScreenDTO safetyCheckScreenStatistical(Integer deptId, Date startTime, Date endTime) throws BizException;


    /**
     * 上报问题类别分析
     *
     * @param deptId
     * @param startTime
     * @param endTime
     * @return
     * @throws BizException
     */
    SafetyCheckScreenDTO safetyCheckTypeAnalysis(Integer deptId, Date startTime, Date endTime) throws BizException;

    /**
     * 未销问题分析
     *
     * @param deptId
     * @param startTime
     * @param endTime
     * @return
     * @throws BizException
     */
    SafetyCheckUnfinishedDTO safetyCheckUnfinished(Integer deptId, Date startTime, Date endTime) throws BizException;


    /**
     * 上报问题部位分析
     *
     * @param deptId
     * @param startTime
     * @param endTime
     * @return
     * @throws BizException
     */
    List<SafetyCheckPartStatisticalDTO> safetyCheckPartAnalysis(Integer deptId, Date startTime, Date endTime) throws BizException;

    List<SafetyCheckDescDTO> descByIds(List<Integer> safetyCheckIds)throws BizException;

    List<SafetyIssueNumDTO> safetyLogGroupByIssueId(Integer deptId) throws BizException;

    StatisticsProgressDTO getStatisticsProgressDTO(Integer deptId, Integer userId, String startTime, String endTime);

    CheckStatisticsDTO getCheckStatistics(CheckSearchParam param);

    PageVO<CheckDetailDTO> getCheckPage(CheckSearchParam param);

    void deleteBatch(List<Integer> idList);
}
